﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace PhoneApp3
{
    public partial class MainPage : PhoneApplicationPage
    {
        //Constructor
        public MainPage()
        {
            InitializeComponent();
            AppSettings.StoreSetting<bool>("Chinese", true);
            AppSettings.StoreSetting<bool>("English", false);
            AppSettings.StoreSetting<bool>("Arabic", false);
            AppSettings.StoreSetting<bool>("Japanese", false);
            this.radioButton1.Checked += new RoutedEventHandler(radioButton1_Checked);
            this.radioButton2.Checked += new RoutedEventHandler(radioButton2_Checked);
            this.radioButton3.Checked += new RoutedEventHandler(radioButton3_Checked);
            this.radioButton4.Checked += new RoutedEventHandler(radioButton4_Checked);
           
        }

        private void listBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch (Gamelist.SelectedIndex)
            {
                case 0:
                    NavigationService.Navigate(
                        new Uri("/StrokePanel.xaml", UriKind.Relative));
                    break;
                case 1:
                    NavigationService.Navigate(
                        new Uri("/StrokePanel.xaml", UriKind.Relative));
                    break;
                case 2:
                    NavigationService.Navigate(
                        new Uri("/StrokePanel.xaml", UriKind.Relative));
                    break;
                case 3:
                    NavigationService.Navigate(
                        new Uri("/StrokePanel.xaml", UriKind.Relative));
                    break;
            }
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {

        }

        private void radioButton1_Checked(object sender, RoutedEventArgs e)
        {
            AppSettings.StoreSetting<bool>("Chinese", false);
            AppSettings.StoreSetting<bool>("English", false);
            AppSettings.StoreSetting<bool>("Arabic", true);
            AppSettings.StoreSetting<bool>("Japanese", false);
        }

        private void radioButton2_Checked(object sender, RoutedEventArgs e)
        {
            AppSettings.StoreSetting<bool>("Chinese", false);
            AppSettings.StoreSetting<bool>("English", true);
            AppSettings.StoreSetting<bool>("Arabic", false);
            AppSettings.StoreSetting<bool>("Japanese", false);
        }

        private void radioButton3_Checked(object sender, RoutedEventArgs e)
        {
            AppSettings.StoreSetting<bool>("Chinese", true);
            AppSettings.StoreSetting<bool>("English", false);
            AppSettings.StoreSetting<bool>("Arabic", false);
            AppSettings.StoreSetting<bool>("Japanese", false);
        }

        private void radioButton4_Checked(object sender, RoutedEventArgs e)
        {
            AppSettings.StoreSetting<bool>("Chinese", false);
            AppSettings.StoreSetting<bool>("English", false);
            AppSettings.StoreSetting<bool>("Arabic", false);
            AppSettings.StoreSetting<bool>("Japanese", true);
        }

    }
}
